var t = getApp();

Page({
    data: {
        list: []
    },
    onLoad: function(t) {
        t.gid && this.setData({
            id: t.gid
        }), t.optionId && this.setData({
            goods_option: t.optionId
        }), this.getData(), wx.setNavigationBarTitle({
            title: "库存明细"
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {},
    getData: function() {
        var o = this, n = t.getNetAddresss("plugin.new-retail.frontend.index.getStockDetail");
        t._postNetWork({
            url: n,
            data: {
                goods_id: this.data.id,
                goods_option: this.data.goods_option
            },
            success: function(t) {
                var n = t.data;
                1 == n.result ? o.setData({
                    list: n.data.data
                }) : wx.showToast({
                    title: n.msg,
                    duration: 1e3,
                    icon: "none"
                });
            },
            fail: function(t) {
                wx.hideLoading(), console.log(t.msg);
            }
        });
    }
});